import request from '@/utils/request'
/*协议,政策*/



/**
 * 删除协议
 * @param id
 * @constructor
 */
export function DelAgreement(id) {
  const data = {
    id: id
  }
  return request({
    url: '/admin/system/file/delete',
    method: 'DELETE',
    params: data
  })
}

/**
 * 协议详情
 * @param id
 * @constructor
 */
export function InfoAgreement(id) {
  const data = {
    id: id
  }
  return request({
    url: '/admin/system/file/info',
    method: 'GET',
    params: data
  })
}

/**
 * 协议列表
 * @param pram
 * @constructor
 */
export function TreeListAgreement(pram) {
  const data = {
    belong: pram.belong,
    id: pram.id,
    isDel:pram.isDel,
    limit: pram.limit,
    page: pram.page,
    type: pram.type,
    fileName: pram.fileName,
    content: pram.content
  }
  return request({
    url: '/admin/system/file/getList',
    method: 'GET',
    params: data
  })
}

/**
 * 新增协议
 * @param pram
 * @constructor
 */
export function AddAgreement(pram) {
  const data = {
    belong: pram.belong,
    id: pram.id,
    isDel:0,
    type: pram.type,
    fileName: pram.fileName,
    content: pram.content
  }
  return request({
    url: '/admin/system/file/save',
    method: 'POST',
    data: data
  })
}

/**
 * 更新协议
 * @param pram
 * @constructor
 */
export function UpdateAgreement(pram) {
  const data = {
    belong: pram.belong,
    id: pram.id,
    isDel:0,
    type: pram.type,
    fileName: pram.fileName,
    content: pram.content
  }
  return request({
    url: '/admin/system/file/update',
    method: 'PUT',
    data: data
  })
}
